<?php
namespace app\index\controller;

use think\Config;
use think\Db;
use think\Cache;
use think\cache\Driver;
use Redis;
class Rediscl
{




    public function index()
    {
    
    // $redis =Cache::store('redis');
    /* $redisdata =  $redis->set('name1','value11',3600);
    $redisdata =  $redis->get('name1');
    var_dump($redisdata);die;*/

    $redis = new Redis();
    $redis->connect('127.0.0.1', 6379);
    //$redis->flushAll();//清空redis key值

    $redisdata=$redis->set('name1','1111');
    $redisdata=$redis->get('name1');
    /*	var_dump($redisdata);die;

    // lPush()将一个或多个值插入列表的左侧或头部
    echo $redis->lPush('k1','v1');//1
    echo $redis->lPush('k1','v2');//2
    echo $redis->lPush('k1','v3');//3
    $lp = $redis->lRange('k1',0,-1);*/
    //var_dump($lp);die;
    }




}